home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d11
/
fgl10_c.arc
/
15-01.C
< prev
next >
Wrap
Text File
|
1991-05-22
|
925b
|
40 lines
#include <fastgraf.h>
main()
{
long original, mem0, mem1, mem2;
int mode, old_mode;
printf("Which video mode? ");
scanf("%d",&mode);
if (fg_testmode(mode,0) == 0) {
printf("Your system does not support that video mode.\n");
exit();
}
if (fg_testmode(mode,2) == 0) {
printf("Your system does not have enough memory.\n");
exit();
}
original = fg_memavail();
old_mode = fg_getmode();
fg_setmode(mode);
mem0 = fg_memavail();
fg_allocate(1);
mem1 = fg_memavail();
fg_allocate(2);
mem2 = fg_memavail();
fg_freepage(1);
fg_freepage(2);
fg_setmode(old_mode);
fg_reset();
printf("originally = %ld\n",original);
printf("after setmode = %ld\n",mem0);
printf("after 1st page = %ld\n",mem1);
printf("after 2nd page = %ld\n",mem2);
printf("at end = %ld\n",fg_memavail());
}